package com.site.service.impl;


import com.site.dao.ReceiveDao;

import com.site.dao.impl.ReceiveDaoImpl;

import com.site.pojo.Receive;

import com.site.service.ReceiveService;

import java.util.List;


public class ReceiveServiceImpl implements ReceiveService {
    private ReceiveDao receiveDao = new ReceiveDaoImpl();
    /**
     * 货物入库
     *
     * @param receive
     * @return
     */
    @Override
    public boolean addReceive(Receive receive) {
        return receiveDao.addReceive(receive)==1?true:false;
    }

    /**
     * 查询所有
     *
     * @return
     */
    @Override
    public List<Receive> getAllReceive() {
        return receiveDao.selectAll();
    }

    /**
     * 通过id删除入库单
     *
     * @param rid
     * @return
     */
    @Override
    public boolean deleteByrid(Long rid) {
        return receiveDao.delReceiveByid(rid)==1?true:false;
    }

    /**
     * 按入库单编号查询
     *
     * @param number
     * @return
     */
    @Override
    public Receive seleteByNumber(String number) {
        return receiveDao.selectByReceiveNumber(number);
    }
}
